<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

//会员端
Route::group(['namespace'=>'UserApi','prefix' => 'user'],function (){
    Route::get('class_home_lists', 'ClassController@class_home');
});

//会员登录
//Route::post('login','UserApi\LoginController@login');
Route::any('announcement','UserApi\SystemSetController@announcement');

Route::post('wx_login','UserApi\LoginController@wx_login');

Route::post('banner_list','UserApi\IndexController@banner_list');
Route::post('index','UserApi\TestController@index');

Route::group(['namespace'=>'UserApi','prefix' => 'user'],function () {

    Route::post('class_home_lists', 'ClassController@class_home');

    Route::post('class_home_info','ClassController@class_home_info');

    //课程列表
    Route::post('class_base_info','ClassController@class_base_info')->middleware('user_check');

    //課程安排詳情
    Route::post('class_base_info_detail','ClassController@class_base_info_detail');

    Route::post('teacher_info','TeacherController@info');

    //课程搜索条件
    Route::post('class_where', 'ClassController@lists_where');

    //课程安排详情
    Route::post('plan_info', 'ClassController@plan_info');

    //積分計劃
    Route::post('intgral_plan_list', 'IntegralPlanController@intgral_plan_list');
    //積分計劃詳情
    Route::post('intgral_plan_info', 'IntegralPlanController@intgral_plan_info');
    //积分计划封面
    Route::post('intgral_cove', 'IntegralPlanController@intgral_cove');
    //现金封面
    Route::post('cash_cove', 'IntegralPlanController@cash_cove');
    //公司收款二维码
    Route::post('company_intgral_cove', 'IntegralPlanController@company_intgral_cove');
    //支付方式列表
    Route::post('pay_type_list', 'PaytypeController@pay_type_list');

    //camp 詳情
    Route::post('group_info','GroupClassController@group_info');
    //camp 列表
    Route::post('group_list','GroupClassController@group_list');

    //系統設置
    Route::any('rule','SystemSetController@index');

    //优惠推广列表
    Route::any('discount_list','DiscountController@discount_list');
    //优惠推广详情
    Route::any('discount_info','DiscountController@discount_info');
});

//会员端
Route::group(['namespace'=>'UserApi','prefix' => 'user','middleware' =>'user_check'],function (){

    //用戶預約
    Route::post('create_subscribe','UserSubscribeController@create_subscribe');

    //我的体重
    Route::any('body_weight','UserController@body_weight');

    //我的預約
    Route::post('my_subscribe','UserSubscribeController@my_subscribe');

    //改变预约状态
    Route::post('change_subscribe','UserSubscribeController@change_subscribe');

    //用户
    Route::post('user_info','UserController@user_info');

    //用戶頭像昵稱更新
    Route::any('update_head_nickname','UserController@update_head_nickname');

    //申请审核积分
    Route::post('apply_integral','UserIntegralController@apply_integral');
    //我的申请记录
    Route::post('my_integral','UserIntegralController@my_integral');
    //积分变动记录
    Route::post('integral_change_record','UserIntegralController@integral_change_record');

    //签到打卡
    Route::post('sign_train','UserTrainContoller@sign_train');
    //我的打卡 我的训练记录
    Route::post('user_train','UserTrainContoller@user_train');

    //camp
    //camp 购买camp
    Route::post('by_group','GroupClassController@by_group');
    //请假
    Route::post('change_camp_subscribe','GroupClassController@change_camp_subscribe');

    Route::post('upload_image','UploadController@upload_image');

    //vip列表
    Route::post('vip_list','VipController@lists');
    //vip使用记录
    Route::post('vip_record','VipController@record');
    //優惠券列表
    Route::post('coupon_list','CouponController@coupon_list');
    //優惠券詳情
    Route::post('coupon_info','CouponController@coupon_info');
    //領取優惠券
    Route::post('add_user_coupon','CouponController@add_user_coupon');
    //我的優惠券
    Route::post('my_user_coupon','CouponController@my_user_coupon');
    Route::post('my_user_coupon_info','CouponController@my_user_coupon_info');

    //购买捆绑套餐
    Route::post('buy_discount','DiscountController@buy_discount');

    Route::post('goods_list','GoodsController@goods_list');
    Route::post('goods_info','GoodsController@goods_info');
    Route::post('my_order','GoodsController@my_order');
    Route::post('buy_goods','GoodsController@buy_goods');
    Route::post('my_goods_integral_record','GoodsController@my_goods_integral_record');

    Route::post('my_goods_integral','GoodsController@my_goods_integral');
    Route::post('goods_integral_cove','GoodsController@goods_integral_cove');
});


